import 'package:erp/data/model/process_type.dart';
import 'package:erp/modules/process_apply/widgets/flow_template_card.dart';
import 'package:erp/widgets/page_list/page_list.dart';
import 'package:flutter/material.dart';
import 'package:get/get.dart';

import 'controller.dart';

/// 流程申请
class FlowApply extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    var controller = Get.put(ProcessApplyController());
    return PageListWidget<ProcessType, ProcessApplyController>(
      enableLoad: false,
      createItem: (BuildContext context, int index, ProcessType data) {
        return FlowTemplateCard(
          processType: data,
          onApplyTap: (item) {
            controller.apply(item);
          },
          onSeeTap: (item) => controller.seeFlowChart(item),
        );
      },
    );
  }
}
